<!DOCTYPE html>
<html lang="en">
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>ControlFlow - Documentation</title>


    <link rel="icon" href="favicon.ico?v=2">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/bootstrap/3.3.6/css/bootstrap.min.css">

    <link rel="stylesheet" href="styles/prettify-tomorrow.css">

    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,700">
    <link rel="stylesheet" href="styles/jsdoc-default.css">

    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/ionicons/2.0.1/css/ionicons.min.css">
</head>
<body>

<div class="navbar navbar-default navbar-fixed-top">
  <div class="navbar-header">
    <a class="navbar-brand" href="#">
        <img src="img/async-logo.svg" alt="Async.js">
    </a>
  </div>
  <ul class="nav navbar-nav">
    <li id="version-dropdown" class="dropdown">
      <a href="#" class="dropdown-toggle vertically-centered" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">v2.6.2 <span class="caret"></span>
      </a>
      <ul class="dropdown-menu">
        <li><a href="docs.html">v2.6.2</a></li>
        <li>
          <a href="https://github.com/caolan/async/blob/v1.5.2/README.md">v1.5.x</a>
        </li>
      </ul>
    </li>
    <li><a href="./index.html">Home</a></li>
    <li><a href="./docs.html">Docs</a></li>
    <li><a href="https://github.com/caolan/async/blob/master/CHANGELOG.md">Changelog</a></li>
    <li><a href="https://github.com/caolan/async"><i class="ion-social-github" aria-hidden="true"></i></a></li>
  </ul>
  <ul class="nav navbar-nav navbar-right">
    <form class="navbar-form navbar-left" role="search">
      <div class="form-group">
        <input type="text" class="form-control typeahead" id="doc-search" placeholder="Search" autofocus>
      </div>
    </form>
  </ul>
</div>


<input type="checkbox" id="nav-trigger" class="nav-trigger">
<label for="nav-trigger" class="navicon-button x">
  <div class="navicon"></div>
</label>

<label for="nav-trigger" class="overlay"></label>

<div id="main">
    <div id="main-container" data-spy="scroll" data-target="#toc" data-offset="50">
        
        <h1 class="page-title">Control Flow</h1>
        

        




<section>

<header>
    
        
            
        
    
</header>

<article>
    <div class="container-overview">
    
        
            <div class="description"><p>A collection of <code>async</code> functions for controlling the flow through a script.</p></div>
        

        
            





















<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line56">line 56</a>
    </li></ul></dd>
    

    

    

    
</dl>












        
    
    </div>

    

    

    

     

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    <h4 class="name" id="applyEach"><span class="type-signature">(static) </span>applyEach<span class="signature">(fns, &#x2026;args<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &#x2192; {function}</span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import applyEach from &apos;async/applyEach&apos;;</code></pre><p>Applies the provided arguments to each function in the array, calling
<code>callback</code> after all functions have completed. If you only provide the first
argument, <code>fns</code>, then it will return a function which lets you pass in the
arguments as if it were a single function call. If more arguments are
provided, <code>callback</code> is required while <code>args</code> is still optional.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>fns</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>
|

<span class="param-type">Iterable</span>
|

<span class="param-type">Object</span>


            

            
            </td>

            

            <td class="description last"><p>A collection of <a href="global.html">AsyncFunction</a>s
to all call with the same arguments</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>args</code></td>
            

            <td class="type">
            
                
<span class="param-type">*</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>any number of separate arguments to pass to the
function.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>the final argument should be the callback,
called when all functions have completed processing.</p></td>
        </tr>

    
    </tbody>
</table>




<h5>Returns:</h5>

        
<div class="param-desc">
    <ul>
<li>If only the first argument, <code>fns</code>, is provided, it will
return a function which lets you pass in the arguments as if it were a single
function call. The signature is <code>(..args, callback)</code>. If invoked with any
arguments, <code>callback</code> is required.</li>
</ul>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">function</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>async.applyEach([enableSearch, updateSchema], &apos;bucket&apos;, callback);

// partial application example:
async.each(
    buckets,
    async.applyEach([enableSearch, updateSchema]),
    callback
);</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="applyEach.js.html">applyEach.js</a>, <a href="applyEach.js.html#line4">line 4</a>
    </li></ul></dd>
    

    

    

    
</dl>












        
            

    

    <h4 class="name" id="applyEachSeries"><span class="type-signature">(static) </span>applyEachSeries<span class="signature">(fns, &#x2026;args<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &#x2192; {function}</span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import applyEachSeries from &apos;async/applyEachSeries&apos;;</code></pre><p>The same as <a href="docs.html#applyEach"><code>applyEach</code></a> but runs only a single async operation at a time.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>fns</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>
|

<span class="param-type">Iterable</span>
|

<span class="param-type">Object</span>


            

            
            </td>

            

            <td class="description last"><p>A collection of <a href="global.html">AsyncFunction</a>s to all
call with the same arguments</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>args</code></td>
            

            <td class="type">
            
                
<span class="param-type">*</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>any number of separate arguments to pass to the
function.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>the final argument should be the callback,
called when all functions have completed processing.</p></td>
        </tr>

    
    </tbody>
</table>




<h5>Returns:</h5>

        
<div class="param-desc">
    <ul>
<li>If only the first argument is provided, it will return
a function which lets you pass in the arguments as if it were a single
function call.</li>
</ul>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">function</span>


    </dd>
</dl>

    






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="applyEachSeries.js.html">applyEachSeries.js</a>, <a href="applyEachSeries.js.html#line4">line 4</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p><a href="docs.html#applyEach">async.applyEach</a></p></li>
        </ul>
    </dd>
    

    
</dl>












        
            

    

    <h4 class="name" id="auto"><span class="type-signature">(static) </span>auto<span class="signature">(tasks, concurrency<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import auto from &apos;async/auto&apos;;</code></pre><p>Determines the best order for running the <a href="global.html">AsyncFunction</a>s in <code>tasks</code>, based on
their requirements. Each function can optionally depend on other functions
being completed first, and each function is run as soon as its requirements
are satisfied.</p>
<p>If any of the <a href="global.html">AsyncFunction</a>s pass an error to their callback, the <code>auto</code> sequence
will stop. Further tasks will not execute (so any other functions depending
on it will not run), and the main <code>callback</code> is immediately called with the
error.</p>
<p><a href="global.html">AsyncFunction</a>s also receive an object containing the results of functions which
have completed so far as the first argument, if they have dependencies. If a
task function has no dependencies, it will only be passed a callback.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>tasks</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            

            
            </td>

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>An object. Each of its properties is either a
function or an array of requirements, with the <a href="global.html">AsyncFunction</a> itself the last item
in the array. The object&apos;s key of a property serves as the name of the task
defined by that property, i.e. can be used when specifying requirements for
other tasks. The function receives one or two arguments:</p>
<ul>
<li>a <code>results</code> object, containing the results of the previously executed
functions, only passed if the task has any dependencies,</li>
<li>a <code>callback(err, result)</code> function, which must be called when finished,
passing an <code>error</code> (which can be <code>null</code>) and the result of the function&apos;s
execution.</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>concurrency</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            
                <td class="default">
                
                    Infinity
                
                </td>
            

            <td class="description last"><p>An optional <code>integer</code> for
determining the maximum number of tasks that can be run in parallel. By
default, as many as possible.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>An optional callback which is called when all
the tasks have been completed. It receives the <code>err</code> argument if any <code>tasks</code>
pass an error to their callback. Results are always returned; however, if an
error occurs, no further <code>tasks</code> will be performed, and the results object
will only contain partial results. Invoked with (err, results).</p></td>
        </tr>

    
    </tbody>
</table>




<h5>Returns:</h5>

        
<div class="param-desc">
    <p>undefined</p>
</div>



    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>async.auto({
    // this function will just be passed a callback
    readData: async.apply(fs.readFile, &apos;data.txt&apos;, &apos;utf-8&apos;),
    showData: [&apos;readData&apos;, function(results, cb) {
        // results.readData is the file&apos;s contents
        // ...
    }]
}, callback);

async.auto({
    get_data: function(callback) {
        console.log(&apos;in get_data&apos;);
        // async code to get some data
        callback(null, &apos;data&apos;, &apos;converted to array&apos;);
    },
    make_folder: function(callback) {
        console.log(&apos;in make_folder&apos;);
        // async code to create a directory to store a file in
        // this is run at the same time as getting the data
        callback(null, &apos;folder&apos;);
    },
    write_file: [&apos;get_data&apos;, &apos;make_folder&apos;, function(results, callback) {
        console.log(&apos;in write_file&apos;, JSON.stringify(results));
        // once there is some data and the directory exists,
        // write the data to a file in the directory
        callback(null, &apos;filename&apos;);
    }],
    email_link: [&apos;write_file&apos;, function(results, callback) {
        console.log(&apos;in email_link&apos;, JSON.stringify(results));
        // once the file is written let&apos;s email a link to it...
        // results.write_file contains the filename returned by write_file.
        callback(null, {&apos;file&apos;:results.write_file, &apos;email&apos;:&apos;user@example.com&apos;});
    }]
}, function(err, results) {
    console.log(&apos;err = &apos;, err);
    console.log(&apos;results = &apos;, results);
});</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="auto.js.html">auto.js</a>, <a href="auto.js.html#line13">line 13</a>
    </li></ul></dd>
    

    

    

    
</dl>












        
            

    

    <h4 class="name" id="autoInject"><span class="type-signature">(static) </span>autoInject<span class="signature">(tasks, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import autoInject from &apos;async/autoInject&apos;;</code></pre><p>A dependency-injected version of the <a href="docs.html#auto">async.auto</a> function. Dependent
tasks are specified as parameters to the function, after the usual callback
parameter, with the parameter names matching the names of the tasks it
depends on. This can provide even more readable task graphs which can be
easier to maintain.</p>
<p>If a final callback is specified, the task results are similarly injected,
specified as named parameters after the initial error parameter.</p>
<p>The autoInject function is purely syntactic sugar and its semantics are
otherwise equivalent to <a href="docs.html#auto">async.auto</a>.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>tasks</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            

            
            </td>

            

            <td class="description last"><p>An object, each of whose properties is an <a href="global.html">AsyncFunction</a> of
the form &apos;func([dependencies...], callback). The object&apos;s key of a property
serves as the name of the task defined by that property, i.e. can be used
when specifying requirements for other tasks.</p>
<ul>
<li>The <code>callback</code> parameter is a <code>callback(err, result)</code> which must be called
when finished, passing an <code>error</code> (which can be <code>null</code>) and the result of
the function&apos;s execution. The remaining parameters name other tasks on
which the task is dependent, and the results from those tasks are the
arguments of those parameters.</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>An optional callback which is called when all
the tasks have been completed. It receives the <code>err</code> argument if any <code>tasks</code>
pass an error to their callback, and a <code>results</code> object with any completed
task results, similar to <code>auto</code>.</p></td>
        </tr>

    
    </tbody>
</table>






    <h5>Example</h5>
    
    <pre class="prettyprint"><code>//  The example from `auto` can be rewritten as follows:
async.autoInject({
    get_data: function(callback) {
        // async code to get some data
        callback(null, &apos;data&apos;, &apos;converted to array&apos;);
    },
    make_folder: function(callback) {
        // async code to create a directory to store a file in
        // this is run at the same time as getting the data
        callback(null, &apos;folder&apos;);
    },
    write_file: function(get_data, make_folder, callback) {
        // once there is some data and the directory exists,
        // write the data to a file in the directory
        callback(null, &apos;filename&apos;);
    },
    email_link: function(write_file, callback) {
        // once the file is written let&apos;s email a link to it...
        // write_file contains the filename returned by write_file.
        callback(null, {&apos;file&apos;:write_file, &apos;email&apos;:&apos;user@example.com&apos;});
    }
}, function(err, results) {
    console.log(&apos;err = &apos;, err);
    console.log(&apos;email_link = &apos;, results.email_link);
});

// If you are using a JS minifier that mangles parameter names, `autoInject`
// will not work with plain functions, since the parameter names will be
// collapsed to a single letter identifier.  To work around this, you can
// explicitly specify the names of the parameters your task function needs
// in an array, similar to Angular.js dependency injection.

// This still has an advantage over plain `auto`, since the results a task
// depends on are still spread into arguments.
async.autoInject({
    //...
    write_file: [&apos;get_data&apos;, &apos;make_folder&apos;, function(get_data, make_folder, callback) {
        callback(null, &apos;filename&apos;);
    }],
    email_link: [&apos;write_file&apos;, function(write_file, callback) {
        callback(null, {&apos;file&apos;:write_file, &apos;email&apos;:&apos;user@example.com&apos;});
    }]
    //...
}, function(err, results) {
    console.log(&apos;err = &apos;, err);
    console.log(&apos;email_link = &apos;, results.email_link);
});</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="autoInject.js.html">autoInject.js</a>, <a href="autoInject.js.html#line24">line 24</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p><a href="docs.html#auto">async.auto</a></p></li>
        </ul>
    </dd>
    

    
</dl>












        
            

    

    <h4 class="name" id="cargo"><span class="type-signature">(static) </span>cargo<span class="signature">(worker, payload<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &#x2192; {<a href="docs.html#CargoObject">CargoObject</a>}</span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import cargo from &apos;async/cargo&apos;;</code></pre><p>Creates a <code>cargo</code> object with the specified payload. Tasks added to the
cargo will be processed altogether (up to the <code>payload</code> limit). If the
<code>worker</code> is in progress, the task is queued until it becomes available. Once
the <code>worker</code> has completed some tasks, each callback of those tasks is
called. Check out <a href="https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966">these</a> <a href="https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966">animations</a>
for how <code>cargo</code> and <code>queue</code> work.</p>
<p>While <a href="docs.html#queue"><code>queue</code></a> passes only one task to one of a group of workers
at a time, cargo passes an array of tasks to a single worker, repeating
when the worker is finished.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>worker</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>An asynchronous function for processing an array
of queued tasks. Invoked with <code>(tasks, callback)</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>payload</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            
                <td class="default">
                
                    Infinity
                
                </td>
            

            <td class="description last"><p>An optional <code>integer</code> for determining
how many tasks should be processed per round; if omitted, the default is
unlimited.</p></td>
        </tr>

    
    </tbody>
</table>




<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A cargo object to manage the tasks. Callbacks can
attached as certain properties to listen for specific events during the
lifecycle of the cargo and inner queue.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="docs.html#CargoObject">CargoObject</a></span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>// create a cargo object with payload 2
var cargo = async.cargo(function(tasks, callback) {
    for (var i=0; i&lt;tasks.length; i++) {
        console.log(&apos;hello &apos; + tasks[i].name);
    }
    callback();
}, 2);

// add some items
cargo.push({name: &apos;foo&apos;}, function(err) {
    console.log(&apos;finished processing foo&apos;);
});
cargo.push({name: &apos;bar&apos;}, function(err) {
    console.log(&apos;finished processing bar&apos;);
});
cargo.push({name: &apos;baz&apos;}, function(err) {
    console.log(&apos;finished processing baz&apos;);
});</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="cargo.js.html">cargo.js</a>, <a href="cargo.js.html#line33">line 33</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p><a href="docs.html#queue">async.queue</a></p></li>
        </ul>
    </dd>
    

    
</dl>












        
            

    

    <h4 class="name" id="compose"><span class="type-signature">(static) </span>compose<span class="signature">(&#x2026;functions)</span><span class="type-signature"> &#x2192; {function}</span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import compose from &apos;async/compose&apos;;</code></pre><p>Creates a function which is a composition of the passed asynchronous
functions. Each function consumes the return value of the function that
follows. Composing functions <code>f()</code>, <code>g()</code>, and <code>h()</code> would produce the result
of <code>f(g(h()))</code>, only this version uses callbacks to obtain the return values.</p>
<p>Each function is executed with the <code>this</code> binding of the composed function.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>functions</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            

            <td class="description last"><p>the asynchronous functions to compose</p></td>
        </tr>

    
    </tbody>
</table>




<h5>Returns:</h5>

        
<div class="param-desc">
    <p>an asynchronous function that is the composed
asynchronous <code>functions</code></p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">function</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>function add1(n, callback) {
    setTimeout(function () {
        callback(null, n + 1);
    }, 10);
}

function mul3(n, callback) {
    setTimeout(function () {
        callback(null, n * 3);
    }, 10);
}

var add1mul3 = async.compose(mul3, add1);
add1mul3(4, function (err, result) {
    // result now equals 15
});</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="compose.js.html">compose.js</a>, <a href="compose.js.html#line4">line 4</a>
    </li></ul></dd>
    

    

    

    
</dl>












        
            

    

    <h4 class="name" id="doDuring"><span class="type-signature">(static) </span>doDuring<span class="signature">(fn, test, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import doDuring from &apos;async/doDuring&apos;;</code></pre><p>The post-check version of <a href="docs.html#during"><code>during</code></a>. To reflect the difference in
the order of operations, the arguments <code>test</code> and <code>fn</code> are switched.</p>
<p>Also a version of <a href="docs.html#doWhilst"><code>doWhilst</code></a> with asynchronous <code>test</code> function.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>fn</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            

            <td class="description last"><p>An async function which is called each time
<code>test</code> passes. Invoked with (callback).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>test</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            

            <td class="description last"><p>asynchronous truth test to perform before each
execution of <code>fn</code>. Invoked with (...args, callback), where <code>...args</code> are the
non-error args from the previous callback of <code>fn</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>A callback which is called after the test
function has failed and repeated execution of <code>fn</code> has stopped. <code>callback</code>
will be passed an error if one occurred, otherwise <code>null</code>.</p></td>
        </tr>

    
    </tbody>
</table>










<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="doDuring.js.html">doDuring.js</a>, <a href="doDuring.js.html#line6">line 6</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p><a href="docs.html#during">async.during</a></p></li>
        </ul>
    </dd>
    

    
</dl>












        
            

    

    <h4 class="name" id="doUntil"><span class="type-signature">(static) </span>doUntil<span class="signature">(iteratee, test, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import doUntil from &apos;async/doUntil&apos;;</code></pre><p>Like <a href="docs.html#doWhilst">&apos;doWhilst&apos;</a>, except the <code>test</code> is inverted. Note the
argument ordering differs from <code>until</code>.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>iteratee</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            

            <td class="description last"><p>An async function which is called each time
<code>test</code> fails. Invoked with (callback).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>test</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
            </td>

            

            <td class="description last"><p>synchronous truth test to perform after each
execution of <code>iteratee</code>. Invoked with any non-error callback results of
<code>iteratee</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>A callback which is called after the test
function has passed and repeated execution of <code>iteratee</code> has stopped. <code>callback</code>
will be passed an error and any arguments passed to the final <code>iteratee</code>&apos;s
callback. Invoked with (err, [results]);</p></td>
        </tr>

    
    </tbody>
</table>










<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="doUntil.js.html">doUntil.js</a>, <a href="doUntil.js.html#line3">line 3</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p><a href="docs.html#doWhilst">async.doWhilst</a></p></li>
        </ul>
    </dd>
    

    
</dl>












        
            

    

    <h4 class="name" id="doWhilst"><span class="type-signature">(static) </span>doWhilst<span class="signature">(iteratee, test, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import doWhilst from &apos;async/doWhilst&apos;;</code></pre><p>The post-check version of <a href="docs.html#whilst"><code>whilst</code></a>. To reflect the difference in
the order of operations, the arguments <code>test</code> and <code>iteratee</code> are switched.</p>
<p><code>doWhilst</code> is to <code>whilst</code> as <code>do while</code> is to <code>while</code> in plain JavaScript.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>iteratee</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            

            <td class="description last"><p>A function which is called each time <code>test</code>
passes. Invoked with (callback).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>test</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
            </td>

            

            <td class="description last"><p>synchronous truth test to perform after each
execution of <code>iteratee</code>. Invoked with any non-error callback results of
<code>iteratee</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>A callback which is called after the test
function has failed and repeated execution of <code>iteratee</code> has stopped.
<code>callback</code> will be passed an error and any arguments passed to the final
<code>iteratee</code>&apos;s callback. Invoked with (err, [results]);</p></td>
        </tr>

    
    </tbody>
</table>










<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="doWhilst.js.html">doWhilst.js</a>, <a href="doWhilst.js.html#line7">line 7</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p><a href="docs.html#whilst">async.whilst</a></p></li>
        </ul>
    </dd>
    

    
</dl>












        
            

    

    <h4 class="name" id="during"><span class="type-signature">(static) </span>during<span class="signature">(test, fn, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import during from &apos;async/during&apos;;</code></pre><p>Like <a href="docs.html#whilst"><code>whilst</code></a>, except the <code>test</code> is an asynchronous function that
is passed a callback in the form of <code>function (err, truth)</code>. If error is
passed to <code>test</code> or <code>fn</code>, the main callback is immediately called with the
value of the error.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>test</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            

            <td class="description last"><p>asynchronous truth test to perform before each
execution of <code>fn</code>. Invoked with (callback).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>fn</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            

            <td class="description last"><p>An async function which is called each time
<code>test</code> passes. Invoked with (callback).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>A callback which is called after the test
function has failed and repeated execution of <code>fn</code> has stopped. <code>callback</code>
will be passed an error, if one occurred, otherwise <code>null</code>.</p></td>
        </tr>

    
    </tbody>
</table>






    <h5>Example</h5>
    
    <pre class="prettyprint"><code>var count = 0;

async.during(
    function (callback) {
        return callback(null, count &lt; 5);
    },
    function (callback) {
        count++;
        setTimeout(callback, 1000);
    },
    function (err) {
        // 5 seconds have passed
    }
);</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="during.js.html">during.js</a>, <a href="during.js.html#line5">line 5</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p><a href="docs.html#whilst">async.whilst</a></p></li>
        </ul>
    </dd>
    

    
</dl>












        
            

    

    <h4 class="name" id="forever"><span class="type-signature">(static) </span>forever<span class="signature">(fn, errback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import forever from &apos;async/forever&apos;;</code></pre><p>Calls the asynchronous function <code>fn</code> with a callback parameter that allows it
to call itself again, in series, indefinitely.
If an error is passed to the callback then <code>errback</code> is called with the
error, and execution stops, otherwise it will never be called.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>fn</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            

            <td class="description last"><p>an async function to call repeatedly.
Invoked with (next).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>errback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>when <code>fn</code> passes an error to it&apos;s callback,
this function will be called, and execution stops. Invoked with (err).</p></td>
        </tr>

    
    </tbody>
</table>






    <h5>Example</h5>
    
    <pre class="prettyprint"><code>async.forever(
    function(next) {
        // next is suitable for passing to things that need a callback(err [, whatever]);
        // it will result in this function being called again.
    },
    function(err) {
        // if next is called with a value in its first parameter, it will appear
        // in here as &apos;err&apos;, and execution will stop.
    }
);</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="forever.js.html">forever.js</a>, <a href="forever.js.html#line7">line 7</a>
    </li></ul></dd>
    

    

    

    
</dl>












        
            

    

    <h4 class="name" id="parallel"><span class="type-signature">(static) </span>parallel<span class="signature">(tasks, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import parallel from &apos;async/parallel&apos;;</code></pre><p>Run the <code>tasks</code> collection of functions in parallel, without waiting until
the previous function has completed. If any of the functions pass an error to
its callback, the main <code>callback</code> is immediately called with the value of the
error. Once the <code>tasks</code> have completed, the results are passed to the final
<code>callback</code> as an array.</p>
<p><strong>Note:</strong> <code>parallel</code> is about kicking-off I/O tasks in parallel, not about
parallel execution of code.  If your tasks do not use any timers or perform
any I/O, they will actually be executed in series.  Any synchronous setup
sections for each task will happen one after the other.  JavaScript remains
single-threaded.</p>
<p><strong>Hint:</strong> Use <a href="docs.html#reflect"><code>reflect</code></a> to continue the
execution of other tasks when a task fails.</p>
<p>It is also possible to use an object instead of an array. Each property will
be run as a function and the results will be passed to the final <code>callback</code>
as an object instead of an array. This can be a more readable way of handling
results from async.parallel.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>tasks</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>
|

<span class="param-type">Iterable</span>
|

<span class="param-type">Object</span>


            

            
            </td>

            

            <td class="description last"><p>A collection of
<a href="global.html">async functions</a> to run.
Each async function can complete with any number of optional <code>result</code> values.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>An optional callback to run once all the
functions have completed successfully. This function gets a results array
(or object) containing all the result arguments passed to the task callbacks.
Invoked with (err, results).</p></td>
        </tr>

    
    </tbody>
</table>






    <h5>Example</h5>
    
    <pre class="prettyprint"><code>async.parallel([
    function(callback) {
        setTimeout(function() {
            callback(null, &apos;one&apos;);
        }, 200);
    },
    function(callback) {
        setTimeout(function() {
            callback(null, &apos;two&apos;);
        }, 100);
    }
],
// optional callback
function(err, results) {
    // the results array will equal [&apos;one&apos;,&apos;two&apos;] even though
    // the second function had a shorter timeout.
});

// an example using an object instead of an array
async.parallel({
    one: function(callback) {
        setTimeout(function() {
            callback(null, 1);
        }, 200);
    },
    two: function(callback) {
        setTimeout(function() {
            callback(null, 2);
        }, 100);
    }
}, function(err, results) {
    // results is now equals to: {one: 1, two: 2}
});</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="parallel.js.html">parallel.js</a>, <a href="parallel.js.html#line4">line 4</a>
    </li></ul></dd>
    

    

    

    
</dl>












        
            

    

    <h4 class="name" id="parallelLimit"><span class="type-signature">(static) </span>parallelLimit<span class="signature">(tasks, limit, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import parallelLimit from &apos;async/parallelLimit&apos;;</code></pre><p>The same as <a href="docs.html#parallel"><code>parallel</code></a> but runs a maximum of <code>limit</code> async operations at a
time.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>tasks</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>
|

<span class="param-type">Iterable</span>
|

<span class="param-type">Object</span>


            

            
            </td>

            

            <td class="description last"><p>A collection of
<a href="global.html">async functions</a> to run.
Each async function can complete with any number of optional <code>result</code> values.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>limit</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            

            
            </td>

            

            <td class="description last"><p>The maximum number of async operations at a time.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>An optional callback to run once all the
functions have completed successfully. This function gets a results array
(or object) containing all the result arguments passed to the task callbacks.
Invoked with (err, results).</p></td>
        </tr>

    
    </tbody>
</table>










<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="parallelLimit.js.html">parallelLimit.js</a>, <a href="parallelLimit.js.html#line4">line 4</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p><a href="docs.html#parallel">async.parallel</a></p></li>
        </ul>
    </dd>
    

    
</dl>












        
            

    

    <h4 class="name" id="priorityQueue"><span class="type-signature">(static) </span>priorityQueue<span class="signature">(worker, concurrency)</span><span class="type-signature"> &#x2192; {<a href="docs.html#QueueObject">QueueObject</a>}</span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import priorityQueue from &apos;async/priorityQueue&apos;;</code></pre><p>The same as <a href="docs.html#queue">async.queue</a> only tasks are assigned a priority and
completed in ascending priority order.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>worker</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            

            <td class="description last"><p>An async function for processing a queued task.
If you want to handle errors from an individual task, pass a callback to
<code>q.push()</code>.
Invoked with (task, callback).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>concurrency</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            

            
            </td>

            

            <td class="description last"><p>An <code>integer</code> for determining how many <code>worker</code>
functions should be run in parallel.  If omitted, the concurrency defaults to
<code>1</code>.  If the concurrency is <code>0</code>, an error is thrown.</p></td>
        </tr>

    
    </tbody>
</table>




<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A priorityQueue object to manage the tasks. There are two
differences between <code>queue</code> and <code>priorityQueue</code> objects:</p>
<ul>
<li><code>push(task, priority, [callback])</code> - <code>priority</code> should be a number. If an
array of <code>tasks</code> is given, all tasks will be assigned the same priority.</li>
<li>The <code>unshift</code> method was removed.</li>
</ul>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="docs.html#QueueObject">QueueObject</a></span>


    </dd>
</dl>

    






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="priorityQueue.js.html">priorityQueue.js</a>, <a href="priorityQueue.js.html#line8">line 8</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p><a href="docs.html#queue">async.queue</a></p></li>
        </ul>
    </dd>
    

    
</dl>












        
            

    

    <h4 class="name" id="queue"><span class="type-signature">(static) </span>queue<span class="signature">(worker, concurrency<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &#x2192; {<a href="docs.html#QueueObject">QueueObject</a>}</span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import queue from &apos;async/queue&apos;;</code></pre><p>Creates a <code>queue</code> object with the specified <code>concurrency</code>. Tasks added to the
<code>queue</code> are processed in parallel (up to the <code>concurrency</code> limit). If all
<code>worker</code>s are in progress, the task is queued until one becomes available.
Once a <code>worker</code> completes a <code>task</code>, that <code>task</code>&apos;s callback is called.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>worker</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>An async function for processing a queued task.
If you want to handle errors from an individual task, pass a callback to
<code>q.push()</code>. Invoked with (task, callback).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>concurrency</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            
                <td class="default">
                
                    1
                
                </td>
            

            <td class="description last"><p>An <code>integer</code> for determining how many
<code>worker</code> functions should be run in parallel.  If omitted, the concurrency
defaults to <code>1</code>.  If the concurrency is <code>0</code>, an error is thrown.</p></td>
        </tr>

    
    </tbody>
</table>




<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A queue object to manage the tasks. Callbacks can
attached as certain properties to listen for specific events during the
lifecycle of the queue.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="docs.html#QueueObject">QueueObject</a></span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>// create a queue object with concurrency 2
var q = async.queue(function(task, callback) {
    console.log(&apos;hello &apos; + task.name);
    callback();
}, 2);

// assign a callback
q.drain = function() {
    console.log(&apos;all items have been processed&apos;);
};

// add some items to the queue
q.push({name: &apos;foo&apos;}, function(err) {
    console.log(&apos;finished processing foo&apos;);
});
q.push({name: &apos;bar&apos;}, function (err) {
    console.log(&apos;finished processing bar&apos;);
});

// add some items to the queue (batch-wise)
q.push([{name: &apos;baz&apos;},{name: &apos;bay&apos;},{name: &apos;bax&apos;}], function(err) {
    console.log(&apos;finished processing item&apos;);
});

// add some items to the front of the queue
q.unshift({name: &apos;bar&apos;}, function (err) {
    console.log(&apos;finished processing bar&apos;);
});</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="queue.js.html">queue.js</a>, <a href="queue.js.html#line58">line 58</a>
    </li></ul></dd>
    

    

    

    
</dl>












        
            

    

    <h4 class="name" id="race"><span class="type-signature">(static) </span>race<span class="signature">(tasks, callback)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import race from &apos;async/race&apos;;</code></pre><p>Runs the <code>tasks</code> array of functions in parallel, without waiting until the
previous function has completed. Once any of the <code>tasks</code> complete or pass an
error to its callback, the main <code>callback</code> is immediately called. It&apos;s
equivalent to <code>Promise.race()</code>.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>tasks</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>


            

            
            </td>

            

            <td class="description last"><p>An array containing <a href="global.html">async functions</a>
to run. Each function can complete with an optional <code>result</code> value.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
            </td>

            

            <td class="description last"><p>A callback to run once any of the functions have
completed. This function gets an error or result from the first function that
completed. Invoked with (err, result).</p></td>
        </tr>

    
    </tbody>
</table>




<h5>Returns:</h5>

        
<div class="param-desc">
    <p>undefined</p>
</div>



    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>async.race([
    function(callback) {
        setTimeout(function() {
            callback(null, &apos;one&apos;);
        }, 200);
    },
    function(callback) {
        setTimeout(function() {
            callback(null, &apos;two&apos;);
        }, 100);
    }
],
// main callback
function(err, result) {
    // the result will be equal to &apos;two&apos; as it finishes earlier
});</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="race.js.html">race.js</a>, <a href="race.js.html#line6">line 6</a>
    </li></ul></dd>
    

    

    

    
</dl>












        
            

    

    <h4 class="name" id="retry"><span class="type-signature">(static) </span>retry<span class="signature">(opts<span class="signature-attributes">opt</span>, task, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import retry from &apos;async/retry&apos;;</code></pre><p>Attempts to get a successful response from <code>task</code> no more than <code>times</code> times
before returning an error. If the task is successful, the <code>callback</code> will be
passed the result of the successful task. If all attempts fail, the callback
will be passed the error and result (if any) of the final attempt.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>opts</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>
|

<span class="param-type">number</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            
                <td class="default">
                
                    {times: 5, interval: 0}| 5
                
                </td>
            

            <td class="description last"><p>Can be either an
object with <code>times</code> and <code>interval</code> or a number.</p>
<ul>
<li><code>times</code> - The number of attempts to make before giving up.  The default
is <code>5</code>.</li>
<li><code>interval</code> - The time to wait between retries, in milliseconds.  The
default is <code>0</code>. The interval may also be specified as a function of the
retry count (see example).</li>
<li><code>errorFilter</code> - An optional synchronous function that is invoked on
erroneous result. If it returns <code>true</code> the retry attempts will continue;
if the function returns <code>false</code> the retry flow is aborted with the current
attempt&apos;s error and result being returned to the final callback.
Invoked with (err).</li>
<li>If <code>opts</code> is a number, the number specifies the number of times to retry,
with the default interval of <code>0</code>.</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>task</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>An async function to retry.
Invoked with (callback).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>An optional callback which is called when the
task has succeeded, or after the final failed attempt. It receives the <code>err</code>
and <code>result</code> arguments of the last attempt at completing the <code>task</code>. Invoked
with (err, results).</p></td>
        </tr>

    
    </tbody>
</table>






    <h5>Example</h5>
    
    <pre class="prettyprint"><code>// The `retry` function can be used as a stand-alone control flow by passing
// a callback, as shown below:

// try calling apiMethod 3 times
async.retry(3, apiMethod, function(err, result) {
    // do something with the result
});

// try calling apiMethod 3 times, waiting 200 ms between each retry
async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {
    // do something with the result
});

// try calling apiMethod 10 times with exponential backoff
// (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds)
async.retry({
  times: 10,
  interval: function(retryCount) {
    return 50 * Math.pow(2, retryCount);
  }
}, apiMethod, function(err, result) {
    // do something with the result
});

// try calling apiMethod the default 5 times no delay between each retry
async.retry(apiMethod, function(err, result) {
    // do something with the result
});

// try calling apiMethod only when error condition satisfies, all other
// errors will abort the retry control flow and return to final callback
async.retry({
  errorFilter: function(err) {
    return err.message === &apos;Temporary error&apos;; // only retry on a specific error
  }
}, apiMethod, function(err, result) {
    // do something with the result
});

// to retry individual methods that are not as reliable within other
// control flow functions, use the `retryable` wrapper:
async.auto({
    users: api.getUsers.bind(api),
    payments: async.retryable(3, api.getPayments.bind(api))
}, function(err, results) {
    // do something with the results
});</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="retry.js.html">retry.js</a>, <a href="retry.js.html#line5">line 5</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p><a href="docs.html#retryable">async.retryable</a></p></li>
        </ul>
    </dd>
    

    
</dl>












        
            

    

    <h4 class="name" id="retryable"><span class="type-signature">(static) </span>retryable<span class="signature">(opts<span class="signature-attributes">opt</span>, task)</span><span class="type-signature"> &#x2192; {<a href="global.html">AsyncFunction</a>}</span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import retryable from &apos;async/retryable&apos;;</code></pre><p>A close relative of <a href="docs.html#retry"><code>retry</code></a>.  This method
wraps a task and makes it retryable, rather than immediately calling it
with retries.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>opts</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>
|

<span class="param-type">number</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            
                <td class="default">
                
                    {times: 5, interval: 0}| 5
                
                </td>
            

            <td class="description last"><p>optional
options, exactly the same as from <code>retry</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>task</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the asynchronous function to wrap.
This function will be passed any arguments passed to the returned wrapper.
Invoked with (...args, callback).</p></td>
        </tr>

    
    </tbody>
</table>




<h5>Returns:</h5>

        
<div class="param-desc">
    <p>The wrapped function, which when invoked, will
retry on an error, based on the parameters specified in <code>opts</code>.
This function will accept the same parameters as <code>task</code>.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>async.auto({
    dep1: async.retryable(3, getFromFlakyService),
    process: [&quot;dep1&quot;, async.retryable(3, function (results, cb) {
        maybeProcessData(results.dep1, cb);
    })]
}, callback);</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="retryable.js.html">retryable.js</a>, <a href="retryable.js.html#line5">line 5</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p><a href="docs.html#retry">async.retry</a></p></li>
        </ul>
    </dd>
    

    
</dl>












        
            

    

    <h4 class="name" id="seq"><span class="type-signature">(static) </span>seq<span class="signature">(&#x2026;functions)</span><span class="type-signature"> &#x2192; {function}</span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import seq from &apos;async/seq&apos;;</code></pre><p>Version of the compose function that is more natural to read. Each function
consumes the return value of the previous function. It is the equivalent of
<a href="docs.html#compose">compose</a> with the arguments reversed.</p>
<p>Each function is executed with the <code>this</code> binding of the composed function.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>functions</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            

            <td class="description last"><p>the asynchronous functions to compose</p></td>
        </tr>

    
    </tbody>
</table>




<h5>Returns:</h5>

        
<div class="param-desc">
    <p>a function that composes the <code>functions</code> in order</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">function</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>// Requires lodash (or underscore), express3 and dresende&apos;s orm2.
// Part of an app, that fetches cats of the logged user.
// This example uses `seq` function to avoid overnesting and error
// handling clutter.
app.get(&apos;/cats&apos;, function(request, response) {
    var User = request.models.User;
    async.seq(
        _.bind(User.get, User),  // &apos;User.get&apos; has signature (id, callback(err, data))
        function(user, fn) {
            user.getCats(fn);      // &apos;getCats&apos; has signature (callback(err, data))
        }
    )(req.session.user_id, function (err, cats) {
        if (err) {
            console.error(err);
            response.json({ status: &apos;error&apos;, message: err.message });
        } else {
            response.json({ status: &apos;ok&apos;, message: &apos;Cats found&apos;, data: cats });
        }
    });
});</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="seq.js.html">seq.js</a>, <a href="seq.js.html#line7">line 7</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p><a href="docs.html#compose">async.compose</a></p></li>
        </ul>
    </dd>
    

    
</dl>












        
            

    

    <h4 class="name" id="series"><span class="type-signature">(static) </span>series<span class="signature">(tasks, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import series from &apos;async/series&apos;;</code></pre><p>Run the functions in the <code>tasks</code> collection in series, each one running once
the previous function has completed. If any functions in the series pass an
error to its callback, no more functions are run, and <code>callback</code> is
immediately called with the value of the error. Otherwise, <code>callback</code>
receives an array of results when <code>tasks</code> have completed.</p>
<p>It is also possible to use an object instead of an array. Each property will
be run as a function, and the results will be passed to the final <code>callback</code>
as an object instead of an array. This can be a more readable way of handling
 results from async.series.</p>
<p><strong>Note</strong> that while many implementations preserve the order of object
properties, the <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-8.6">ECMAScript Language Specification</a>
explicitly states that</p>
<blockquote>
<p>The mechanics and order of enumerating the properties is not specified.</p>
</blockquote>
<p>So if you rely on the order in which your series of functions are executed,
and want this to work on all platforms, consider using an array.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>tasks</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>
|

<span class="param-type">Iterable</span>
|

<span class="param-type">Object</span>


            

            
            </td>

            

            <td class="description last"><p>A collection containing
<a href="global.html">async functions</a> to run in series.
Each function can complete with any number of optional <code>result</code> values.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>An optional callback to run once all the
functions have completed. This function gets a results array (or object)
containing all the result arguments passed to the <code>task</code> callbacks. Invoked
with (err, result).</p></td>
        </tr>

    
    </tbody>
</table>






    <h5>Example</h5>
    
    <pre class="prettyprint"><code>async.series([
    function(callback) {
        // do some stuff ...
        callback(null, &apos;one&apos;);
    },
    function(callback) {
        // do some more stuff ...
        callback(null, &apos;two&apos;);
    }
],
// optional callback
function(err, results) {
    // results is now equal to [&apos;one&apos;, &apos;two&apos;]
});

async.series({
    one: function(callback) {
        setTimeout(function() {
            callback(null, 1);
        }, 200);
    },
    two: function(callback){
        setTimeout(function() {
            callback(null, 2);
        }, 100);
    }
}, function(err, results) {
    // results is now equal to: {one: 1, two: 2}
});</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="series.js.html">series.js</a>, <a href="series.js.html#line4">line 4</a>
    </li></ul></dd>
    

    

    

    
</dl>












        
            

    

    <h4 class="name" id="times"><span class="type-signature">(static) </span>times<span class="signature">(n, iteratee, callback)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import times from &apos;async/times&apos;;</code></pre><p>Calls the <code>iteratee</code> function <code>n</code> times, and accumulates results in the same
manner you would use with <a href="docs.html#map">map</a>.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>n</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            

            
            </td>

            

            <td class="description last"><p>The number of times to run the function.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>iteratee</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            

            <td class="description last"><p>The async function to call <code>n</code> times.
Invoked with the iteration index and a callback: (n, next).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
            </td>

            

            <td class="description last"><p>see <a href="docs.html#map">map</a>.</p></td>
        </tr>

    
    </tbody>
</table>






    <h5>Example</h5>
    
    <pre class="prettyprint"><code>// Pretend this is some complicated async factory
var createUser = function(id, callback) {
    callback(null, {
        id: &apos;user&apos; + id
    });
};

// generate 5 users
async.times(5, function(n, next) {
    createUser(n, function(err, user) {
        next(err, user);
    });
}, function(err, users) {
    // we should now have 5 users
});</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="times.js.html">times.js</a>, <a href="times.js.html#line4">line 4</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p><a href="docs.html#map">async.map</a></p></li>
        </ul>
    </dd>
    

    
</dl>












        
            

    

    <h4 class="name" id="timesLimit"><span class="type-signature">(static) </span>timesLimit<span class="signature">(count, limit, iteratee, callback)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import timesLimit from &apos;async/timesLimit&apos;;</code></pre><p>The same as <a href="docs.html#times">times</a> but runs a maximum of <code>limit</code> async operations at a
time.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>count</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            

            
            </td>

            

            <td class="description last"><p>The number of times to run the function.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>limit</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            

            
            </td>

            

            <td class="description last"><p>The maximum number of async operations at a time.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>iteratee</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            

            <td class="description last"><p>The async function to call <code>n</code> times.
Invoked with the iteration index and a callback: (n, next).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
            </td>

            

            <td class="description last"><p>see <a href="docs.html#map">async.map</a>.</p></td>
        </tr>

    
    </tbody>
</table>










<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="timesLimit.js.html">timesLimit.js</a>, <a href="timesLimit.js.html#line5">line 5</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p><a href="docs.html#times">async.times</a></p></li>
        </ul>
    </dd>
    

    
</dl>












        
            

    

    <h4 class="name" id="timesSeries"><span class="type-signature">(static) </span>timesSeries<span class="signature">(n, iteratee, callback)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import timesSeries from &apos;async/timesSeries&apos;;</code></pre><p>The same as <a href="docs.html#times">times</a> but runs only a single async operation at a time.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>n</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            

            
            </td>

            

            <td class="description last"><p>The number of times to run the function.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>iteratee</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            

            <td class="description last"><p>The async function to call <code>n</code> times.
Invoked with the iteration index and a callback: (n, next).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
            </td>

            

            <td class="description last"><p>see <a href="docs.html#map">map</a>.</p></td>
        </tr>

    
    </tbody>
</table>










<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="timesSeries.js.html">timesSeries.js</a>, <a href="timesSeries.js.html#line4">line 4</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p><a href="docs.html#times">async.times</a></p></li>
        </ul>
    </dd>
    

    
</dl>












        
            

    

    <h4 class="name" id="tryEach"><span class="type-signature">(static) </span>tryEach<span class="signature">(tasks, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import tryEach from &apos;async/tryEach&apos;;</code></pre><p>It runs each task in series but stops whenever any of the functions were
successful. If one of the tasks were successful, the <code>callback</code> will be
passed the result of the successful task. If all tasks fail, the callback
will be passed the error and result (if any) of the final attempt.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>tasks</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>
|

<span class="param-type">Iterable</span>
|

<span class="param-type">Object</span>


            

            
            </td>

            

            <td class="description last"><p>A collection containing functions to
run, each function is passed a <code>callback(err, result)</code> it must call on
completion with an error <code>err</code> (which can be <code>null</code>) and an optional <code>result</code>
value.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>An optional callback which is called when one
of the tasks has succeeded, or all have failed. It receives the <code>err</code> and
<code>result</code> arguments of the last attempt at completing the <code>task</code>. Invoked with
(err, results).</p></td>
        </tr>

    
    </tbody>
</table>






    <h5>Example</h5>
    
    <pre class="prettyprint"><code>async.tryEach([
    function getDataFromFirstWebsite(callback) {
        // Try getting the data from the first website
        callback(err, data);
    },
    function getDataFromSecondWebsite(callback) {
        // First website failed,
        // Try getting the data from the backup website
        callback(err, data);
    }
],
// optional callback
function(err, results) {
    Now do something with the data.
});</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="tryEach.js.html">tryEach.js</a>, <a href="tryEach.js.html#line6">line 6</a>
    </li></ul></dd>
    

    

    

    
</dl>












        
            

    

    <h4 class="name" id="until"><span class="type-signature">(static) </span>until<span class="signature">(test, iteratee, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import until from &apos;async/until&apos;;</code></pre><p>Repeatedly call <code>iteratee</code> until <code>test</code> returns <code>true</code>. Calls <code>callback</code> when
stopped, or an error occurs. <code>callback</code> will be passed an error and any
arguments passed to the final <code>iteratee</code>&apos;s callback.</p>
<p>The inverse of <a href="docs.html#whilst">whilst</a>.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>test</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
            </td>

            

            <td class="description last"><p>synchronous truth test to perform before each
execution of <code>iteratee</code>. Invoked with ().</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>iteratee</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            

            <td class="description last"><p>An async function which is called each time
<code>test</code> fails. Invoked with (callback).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>A callback which is called after the test
function has passed and repeated execution of <code>iteratee</code> has stopped. <code>callback</code>
will be passed an error and any arguments passed to the final <code>iteratee</code>&apos;s
callback. Invoked with (err, [results]);</p></td>
        </tr>

    
    </tbody>
</table>










<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="until.js.html">until.js</a>, <a href="until.js.html#line3">line 3</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><p><a href="docs.html#whilst">async.whilst</a></p></li>
        </ul>
    </dd>
    

    
</dl>












        
            

    

    <h4 class="name" id="waterfall"><span class="type-signature">(static) </span>waterfall<span class="signature">(tasks, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import waterfall from &apos;async/waterfall&apos;;</code></pre><p>Runs the <code>tasks</code> array of functions in series, each passing their results to
the next in the array. However, if any of the <code>tasks</code> pass an error to their
own callback, the next function is not executed, and the main <code>callback</code> is
immediately called with the error.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>tasks</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>


            

            
            </td>

            

            <td class="description last"><p>An array of <a href="global.html">async functions</a>
to run.
Each function should complete with any number of <code>result</code> values.
The <code>result</code> values will be passed as arguments, in order, to the next task.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>An optional callback to run once all the
functions have completed. This will be passed the results of the last task&apos;s
callback. Invoked with (err, [results]).</p></td>
        </tr>

    
    </tbody>
</table>




<h5>Returns:</h5>

        
<div class="param-desc">
    <p>undefined</p>
</div>



    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>async.waterfall([
    function(callback) {
        callback(null, &apos;one&apos;, &apos;two&apos;);
    },
    function(arg1, arg2, callback) {
        // arg1 now equals &apos;one&apos; and arg2 now equals &apos;two&apos;
        callback(null, &apos;three&apos;);
    },
    function(arg1, callback) {
        // arg1 now equals &apos;three&apos;
        callback(null, &apos;done&apos;);
    }
], function (err, result) {
    // result now equals &apos;done&apos;
});

// Or, with named functions:
async.waterfall([
    myFirstFunction,
    mySecondFunction,
    myLastFunction,
], function (err, result) {
    // result now equals &apos;done&apos;
});
function myFirstFunction(callback) {
    callback(null, &apos;one&apos;, &apos;two&apos;);
}
function mySecondFunction(arg1, arg2, callback) {
    // arg1 now equals &apos;one&apos; and arg2 now equals &apos;two&apos;
    callback(null, &apos;three&apos;);
}
function myLastFunction(arg1, callback) {
    // arg1 now equals &apos;three&apos;
    callback(null, &apos;done&apos;);
}</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="waterfall.js.html">waterfall.js</a>, <a href="waterfall.js.html#line9">line 9</a>
    </li></ul></dd>
    

    

    

    
</dl>












        
            

    

    <h4 class="name" id="whilst"><span class="type-signature">(static) </span>whilst<span class="signature">(test, iteratee, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <pre class="prettyprint source"><code>import whilst from &apos;async/whilst&apos;;</code></pre><p>Repeatedly call <code>iteratee</code>, while <code>test</code> returns <code>true</code>. Calls <code>callback</code> when
stopped, or an error occurs.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>


        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>test</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
            </td>

            

            <td class="description last"><p>synchronous truth test to perform before each
execution of <code>iteratee</code>. Invoked with ().</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>iteratee</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html">AsyncFunction</a></span>


            

            
            </td>

            

            <td class="description last"><p>An async function which is called each time
<code>test</code> passes. Invoked with (callback).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            

            
                <span class="optional">&lt;optional&gt;</span>
            
            </td>

            

            <td class="description last"><p>A callback which is called after the test
function has failed and repeated execution of <code>iteratee</code> has stopped. <code>callback</code>
will be passed an error and any arguments passed to the final <code>iteratee</code>&apos;s
callback. Invoked with (err, [results]);</p></td>
        </tr>

    
    </tbody>
</table>




<h5>Returns:</h5>

        
<div class="param-desc">
    <p>undefined</p>
</div>



    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>var count = 0;
async.whilst(
    function() { return count &lt; 5; },
    function(callback) {
        count++;
        setTimeout(function() {
            callback(null, count);
        }, 1000);
    },
    function (err, n) {
        // 5 seconds have passed, n = 5
    }
);</code></pre>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="whilst.js.html">whilst.js</a>, <a href="whilst.js.html#line7">line 7</a>
    </li></ul></dd>
    

    

    

    
</dl>












        
    

    
        <h3 class="subsection-title">Type Definitions</h3>

        
                
<h4 class="name" id="CargoObject">CargoObject</h4>




<div class="description">
    <pre class="prettyprint source"><code>import cargo from &apos;async/cargo&apos;;</code></pre><p>A cargo of tasks for the worker function to complete. Cargo inherits all of
the same methods and event callbacks as <a href="docs.html#queue"><code>queue</code></a>.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Object</span>


        </li>
    </ul>





    <h5 class="subsection-title">Properties:</h5>

    

<table class="props">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>length</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>A function returning the number of items
waiting to be processed. Invoke like <code>cargo.length()</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>payload</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"><p>An <code>integer</code> for determining how many tasks
should be process per round. This property can be changed after a <code>cargo</code> is
created to alter the payload on-the-fly.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>push</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>Adds <code>task</code> to the <code>queue</code>. The callback is
called once the <code>worker</code> has finished processing the task. Instead of a
single task, an array of <code>tasks</code> can be submitted. The respective callback is
used for every task in the list. Invoke like <code>cargo.push(task, [callback])</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>saturated</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>A callback that is called when the
<code>queue.length()</code> hits the concurrency and further tasks will be queued.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>empty</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>A callback that is called when the last item
from the <code>queue</code> is given to a <code>worker</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>drain</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>A callback that is called when the last item
from the <code>queue</code> has returned from the <code>worker</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>idle</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>a function returning false if there are items
waiting or being processed, or true if not. Invoke like <code>cargo.idle()</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>pause</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>a function that pauses the processing of tasks
until <code>resume()</code> is called. Invoke like <code>cargo.pause()</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>resume</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>a function that resumes the processing of
queued tasks when the queue is paused. Invoke like <code>cargo.resume()</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>kill</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>a function that removes the <code>drain</code> callback and
empties remaining tasks from the queue forcing it to go idle. Invoke like <code>cargo.kill()</code>.</p></td>
        </tr>

    
    </tbody>
</table>




<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="cargo.js.html">cargo.js</a>, <a href="cargo.js.html#line3">line 3</a>
    </li></ul></dd>
    

    

    

    
</dl>






            
                
<h4 class="name" id="QueueObject">QueueObject</h4>




<div class="description">
    <pre class="prettyprint source"><code>import queue from &apos;async/queue&apos;;</code></pre><p>A queue of tasks for the worker function to complete.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Object</span>


        </li>
    </ul>





    <h5 class="subsection-title">Properties:</h5>

    

<table class="props">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>length</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>a function returning the number of items
waiting to be processed. Invoke with <code>queue.length()</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>started</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>


            
            </td>

            

            

            <td class="description last"><p>a boolean indicating whether or not any
items have been pushed and processed by the queue.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>running</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>a function returning the number of items
currently being processed. Invoke with <code>queue.running()</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>workersList</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>a function returning the array of items
currently being processed. Invoke with <code>queue.workersList()</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>idle</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>a function returning false if there are items
waiting or being processed, or true if not. Invoke with <code>queue.idle()</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>concurrency</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"><p>an integer for determining how many <code>worker</code>
functions should be run in parallel. This property can be changed after a
<code>queue</code> is created to alter the concurrency on-the-fly.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>push</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>add a new task to the <code>queue</code>. Calls <code>callback</code>
once the <code>worker</code> has finished processing the task. Instead of a single task,
a <code>tasks</code> array can be submitted. The respective callback is used for every
task in the list. Invoke with <code>queue.push(task, [callback])</code>,</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>unshift</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>add a new task to the front of the <code>queue</code>.
Invoke with <code>queue.unshift(task, [callback])</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>remove</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>remove items from the queue that match a test
function.  The test function will be passed an object with a <code>data</code> property,
and a <code>priority</code> property, if this is a
<a href="docs.html#priorityQueue">priorityQueue</a> object.
Invoked with <code>queue.remove(testFn)</code>, where <code>testFn</code> is of the form
<code>function ({data, priority}) {}</code> and returns a Boolean.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>saturated</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>a callback that is called when the number of
running workers hits the <code>concurrency</code> limit, and further tasks will be
queued.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>unsaturated</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>a callback that is called when the number
of running workers is less than the <code>concurrency</code> &amp; <code>buffer</code> limits, and
further tasks will not be queued.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>buffer</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"><p>A minimum threshold buffer in order to say that
the <code>queue</code> is <code>unsaturated</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>empty</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>a callback that is called when the last item
from the <code>queue</code> is given to a <code>worker</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>drain</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>a callback that is called when the last item
from the <code>queue</code> has returned from the <code>worker</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>error</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>a callback that is called when a task errors.
Has the signature <code>function(error, task)</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>paused</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>


            
            </td>

            

            

            <td class="description last"><p>a boolean for determining whether the queue is
in a paused state.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>pause</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>a function that pauses the processing of tasks
until <code>resume()</code> is called. Invoke with <code>queue.pause()</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>resume</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>a function that resumes the processing of
queued tasks when the queue is paused. Invoke with <code>queue.resume()</code>.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>kill</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>a function that removes the <code>drain</code> callback and
empties remaining tasks from the queue forcing it to go idle. No more tasks
should be pushed to the queue after calling this function. Invoke with <code>queue.kill()</code>.</p></td>
        </tr>

    
    </tbody>
</table>




<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="queue.js.html">queue.js</a>, <a href="queue.js.html#line4">line 4</a>
    </li></ul></dd>
    

    

    

    
</dl>






            
    

    
</article>

</section>




    <footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun May 26 2019 15:21:49 GMT-0700 (Pacific Daylight Time) using the Minami theme.
 Documentation has been modified from the original.  For more information, please see the <a href="https://github.com/caolan/async">async</a> repository.</footer></div>
</div>

<nav id="toc">
    <h3>Methods:</h3><ul class="nav methods"><li class="toc-header"><a href="docs.html#collections">Collections</a></li><li data-type="method" class="toc-method"><a href="docs.html#concat">concat</a></li><li data-type="method" class="toc-method"><a href="docs.html#concatLimit">concatLimit</a></li><li data-type="method" class="toc-method"><a href="docs.html#concatSeries">concatSeries</a></li><li data-type="method" class="toc-method"><a href="docs.html#detect">detect</a></li><li data-type="method" class="toc-method"><a href="docs.html#detectLimit">detectLimit</a></li><li data-type="method" class="toc-method"><a href="docs.html#detectSeries">detectSeries</a></li><li data-type="method" class="toc-method"><a href="docs.html#each">each</a></li><li data-type="method" class="toc-method"><a href="docs.html#eachLimit">eachLimit</a></li><li data-type="method" class="toc-method"><a href="docs.html#eachOf">eachOf</a></li><li data-type="method" class="toc-method"><a href="docs.html#eachOfLimit">eachOfLimit</a></li><li data-type="method" class="toc-method"><a href="docs.html#eachOfSeries">eachOfSeries</a></li><li data-type="method" class="toc-method"><a href="docs.html#eachSeries">eachSeries</a></li><li data-type="method" class="toc-method"><a href="docs.html#every">every</a></li><li data-type="method" class="toc-method"><a href="docs.html#everyLimit">everyLimit</a></li><li data-type="method" class="toc-method"><a href="docs.html#everySeries">everySeries</a></li><li data-type="method" class="toc-method"><a href="docs.html#filter">filter</a></li><li data-type="method" class="toc-method"><a href="docs.html#filterLimit">filterLimit</a></li><li data-type="method" class="toc-method"><a href="docs.html#filterSeries">filterSeries</a></li><li data-type="method" class="toc-method"><a href="docs.html#groupBy">groupBy</a></li><li data-type="method" class="toc-method"><a href="docs.html#groupByLimit">groupByLimit</a></li><li data-type="method" class="toc-method"><a href="docs.html#groupBySeries">groupBySeries</a></li><li data-type="method" class="toc-method"><a href="docs.html#map">map</a></li><li data-type="method" class="toc-method"><a href="docs.html#mapLimit">mapLimit</a></li><li data-type="method" class="toc-method"><a href="docs.html#mapSeries">mapSeries</a></li><li data-type="method" class="toc-method"><a href="docs.html#mapValues">mapValues</a></li><li data-type="method" class="toc-method"><a href="docs.html#mapValuesLimit">mapValuesLimit</a></li><li data-type="method" class="toc-method"><a href="docs.html#mapValuesSeries">mapValuesSeries</a></li><li data-type="method" class="toc-method"><a href="docs.html#reduce">reduce</a></li><li data-type="method" class="toc-method"><a href="docs.html#reduceRight">reduceRight</a></li><li data-type="method" class="toc-method"><a href="docs.html#reject">reject</a></li><li data-type="method" class="toc-method"><a href="docs.html#rejectLimit">rejectLimit</a></li><li data-type="method" class="toc-method"><a href="docs.html#rejectSeries">rejectSeries</a></li><li data-type="method" class="toc-method"><a href="docs.html#some">some</a></li><li data-type="method" class="toc-method"><a href="docs.html#someLimit">someLimit</a></li><li data-type="method" class="toc-method"><a href="docs.html#someSeries">someSeries</a></li><li data-type="method" class="toc-method"><a href="docs.html#sortBy">sortBy</a></li><li data-type="method" class="toc-method"><a href="docs.html#transform">transform</a></li><li class="toc-header"><a href="docs.html#controlflow">Control Flow</a></li><li data-type="method" class="toc-method"><a href="docs.html#applyEach">applyEach</a></li><li data-type="method" class="toc-method"><a href="docs.html#applyEachSeries">applyEachSeries</a></li><li data-type="method" class="toc-method"><a href="docs.html#auto">auto</a></li><li data-type="method" class="toc-method"><a href="docs.html#autoInject">autoInject</a></li><li data-type="method" class="toc-method"><a href="docs.html#cargo">cargo</a></li><li data-type="method" class="toc-method"><a href="docs.html#compose">compose</a></li><li data-type="method" class="toc-method"><a href="docs.html#doDuring">doDuring</a></li><li data-type="method" class="toc-method"><a href="docs.html#doUntil">doUntil</a></li><li data-type="method" class="toc-method"><a href="docs.html#doWhilst">doWhilst</a></li><li data-type="method" class="toc-method"><a href="docs.html#during">during</a></li><li data-type="method" class="toc-method"><a href="docs.html#forever">forever</a></li><li data-type="method" class="toc-method"><a href="docs.html#parallel">parallel</a></li><li data-type="method" class="toc-method"><a href="docs.html#parallelLimit">parallelLimit</a></li><li data-type="method" class="toc-method"><a href="docs.html#priorityQueue">priorityQueue</a></li><li data-type="method" class="toc-method"><a href="docs.html#queue">queue</a></li><li data-type="method" class="toc-method"><a href="docs.html#race">race</a></li><li data-type="method" class="toc-method"><a href="docs.html#retry">retry</a></li><li data-type="method" class="toc-method"><a href="docs.html#retryable">retryable</a></li><li data-type="method" class="toc-method"><a href="docs.html#seq">seq</a></li><li data-type="method" class="toc-method"><a href="docs.html#series">series</a></li><li data-type="method" class="toc-method"><a href="docs.html#times">times</a></li><li data-type="method" class="toc-method"><a href="docs.html#timesLimit">timesLimit</a></li><li data-type="method" class="toc-method"><a href="docs.html#timesSeries">timesSeries</a></li><li data-type="method" class="toc-method"><a href="docs.html#tryEach">tryEach</a></li><li data-type="method" class="toc-method"><a href="docs.html#until">until</a></li><li data-type="method" class="toc-method"><a href="docs.html#waterfall">waterfall</a></li><li data-type="method" class="toc-method"><a href="docs.html#whilst">whilst</a></li><li class="toc-header"><a href="docs.html#utils">Utils</a></li><li data-type="method" class="toc-method"><a href="docs.html#apply">apply</a></li><li data-type="method" class="toc-method"><a href="docs.html#asyncify">asyncify</a></li><li data-type="method" class="toc-method"><a href="docs.html#constant">constant</a></li><li data-type="method" class="toc-method"><a href="docs.html#dir">dir</a></li><li data-type="method" class="toc-method"><a href="docs.html#ensureAsync">ensureAsync</a></li><li data-type="method" class="toc-method"><a href="docs.html#log">log</a></li><li data-type="method" class="toc-method"><a href="docs.html#memoize">memoize</a></li><li data-type="method" class="toc-method"><a href="docs.html#nextTick">nextTick</a></li><li data-type="method" class="toc-method"><a href="docs.html#reflect">reflect</a></li><li data-type="method" class="toc-method"><a href="docs.html#reflectAll">reflectAll</a></li><li data-type="method" class="toc-method"><a href="docs.html#setImmediate">setImmediate</a></li><li data-type="method" class="toc-method"><a href="docs.html#timeout">timeout</a></li><li data-type="method" class="toc-method"><a href="docs.html#unmemoize">unmemoize</a></li></ul><h3>Methods:</h3>
</nav>

<br class="clear">




<script src="https://cdn.jsdelivr.net/prettify/0.1/prettify.js"></script>

<script src="https://cdn.jsdelivr.net/jquery/2.2.4/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/typeahead.js/0.11.1/typeahead.bundle.min.js"></script>
<script>prettyPrint();</script>
<script src="scripts/async.js"></script>

<script src="scripts/linenumber.js" async></script>
<script src="scripts/jsdoc-custom.js" async></script>
</body>